package com.ostrich.note.ui.calendar;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;

import android.os.Bundle;
import android.view.View;

import com.ostrich.note.R;
import com.ostrich.note.base.BaseActivity;
import com.ostrich.note.databinding.ActivityCalendarNoteBinding;
import com.ostrich.note.ui.note.adapter.NoteAdapter;
import com.ostrich.note.ui.note.entity.NoteEntity;

import java.util.ArrayList;

public class CalendarNoteActivity extends BaseActivity<ActivityCalendarNoteBinding> {
    private ArrayList<NoteEntity> data;
    private String date;
    private NoteAdapter mNoteAdapter;

    @Override
    protected void iniView() {
        data = (ArrayList<NoteEntity>) getBundle().getSerializable("list");
        date = getBundle().getString("date");
        binding.tvDate.setText(date);

        mNoteAdapter = new NoteAdapter();
        binding.rv.setAdapter(mNoteAdapter);
        binding.rv.setLayoutManager(new LinearLayoutManager(this));

        mNoteAdapter.setData(data);

    }

    @Override
    public int getLayout() {
        return R.layout.activity_calendar_note;
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {
        binding.clBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

    }
}